package com.itly.rwcs.controller;

import com.itly.rwcs.pojo.*;
import com.itly.rwcs.service.visualIargeScreenService;
import com.itly.rwcs.uitls.bubbleSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 罗言
 * @Version: 1.0
 * @Date: 2024-02-15-16:19
 * @Description:
 */
@Controller
@RequestMapping("/vis")
public class visualIargeScreenController {

    @Autowired
    private visualIargeScreenService service;

    @GetMapping("/data1")
    @ResponseBody
    public Result getData1() {
        List<paramTemp> data = service.getData1();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data2")
    @ResponseBody
    public Result getData2() {
        List<paramTemp> data = service.getData2();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data3")
    @ResponseBody
    public Result getData3() {
        List<paramTemp> data = service.getData3();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data4")
    @ResponseBody
    public Result getData4() {
        List<paramTemp> data = service.getData4();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data5")
    @ResponseBody
    public Result getData5() {
        List<paramTemp> data = service.getData5();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data6")
    @ResponseBody
    public Result getData6() {
        List<paramTemp> data = service.getData6();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data7")
    @ResponseBody
    public Result getData7() {
        List<paramTemp> data = bubbleSort.sort(service.getData7());

        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data8")
    @ResponseBody
    public Result getData8() {
        List<paramTemp> data = bubbleSort.sort(service.getData8());
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data9")
    @ResponseBody
    public Result getData9() {
        List<paramTemp> data = service.getData9();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data10")
    @ResponseBody
    public Result getData10() {
        List<paramTemp> data = service.getData10();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data11")
    @ResponseBody
    public Result getData11() {
        List<paramTemp> data = service.getData11();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data12")
    @ResponseBody
    public Result getData12() {
        List<paramTemp> data = service.getData12();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data13")
    @ResponseBody
    public Result getData13() {
        List<paramTemp> data = service.getData13();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data14")
    @ResponseBody
    public Result getData14() {
        List<paramTemp> data = service.getData14();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data15")
    @ResponseBody
    public Result getData15() {
        List<paramTemp> data = service.getData15();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data16")
    @ResponseBody
    public Result getData16() {
        List<paramTemp> data = service.getData16();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data17")
    @ResponseBody
    public Result getData17() {
        List<paramTemp> data = service.getData17();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data18")
    @ResponseBody
    public Result getData18() {
        Integer count = service.getData18();
        return new Result(count > 0 ? Code.GET_OK : Code.GET_ERR, count);
    }

    @PostMapping("/data19")
    @ResponseBody
    public Result getData19(@RequestBody PageParam param) {
        List<paramAll> dataAll = service.getData19(param.getStart(), param.end);
        return new Result(dataAll != null ? Code.GET_OK : Code.GET_ERR, dataAll);
    }

    @GetMapping("/data20")
    @ResponseBody
    public Result getData20() {
        List<paramTemp> data = service.getData20();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data21")
    @ResponseBody
    public Result getData21() {
        List<paramTemp> data = service.getData21();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data22")
    @ResponseBody
    public Result getData22() {
        List<paramTemp> data = service.getData22();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data23")
    @ResponseBody
    public Result getData23() {
        List<paramTemp> data = service.getData23();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data24")
    @ResponseBody
    public Result getData24() {
        List<paramTemp> data = service.getData24();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data25")
    @ResponseBody
    public Result getData25() {
        List<paramTemp> data = service.getData25();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }
}
